import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { dirname } from "path";

// https://vite.dev/config/
export default defineConfig({
  base: "/xldd-admin/",
  root: "xldd-admin/",
  server: {
    port: 5176,
  },
  // build: {
  //   rollupOptions: {
  //     input: {
  //       main: resolve(__dirname, "index.html"),
  //     },
  //     output: {
  //       entryFileNames: (chunkInfo) => {
  //         if (chunkInfo.name === "main") return "index.html";
  //         return "";
  //       },
  //     },
  //   },
  // },
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: (tag) => tag.startsWith("iconpark-icon"),
        },
      },
    }),
  ],
  resolve: {
    alias: {
      "@": dirname(__dirname),
    },
  },
});
